package com.example.demo.controller;

import com.example.demo.fegin.AppOneClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Mark.xu
 * @create 2021-01-19 17:39
 */
@RestController
public class AppTowContro {
//    @Autowired
//    private RestTemplate restTemplate ;

//    String server_name = "my-application1" ;
//
//    @RequestMapping("/showInfo")
//    public Map<String,String> showInfo (){
//        return restTemplate.getForObject("http://"+server_name+"/getInfo",Map.class) ;
//    }
    /**
     * 使用 Fegin 调用
     */
    @Autowired
    private AppOneClient appOneClient;
    @RequestMapping("/showInfo2")
    public Map<String,String> showInfo2 (){
        return appOneClient.getMap();
    }
}
